//
//  MBBaseTableCellViewModel.m
//  MemberBusiness-ios
//
//  Created by cherry pu on 2018/4/18.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBBaseTableCellViewModel.h"

@interface MBBaseTableCellViewModel ()
@property (nonatomic,strong) MBBaseTableCellViewModel *viewModel;

@end

@implementation MBBaseTableCellViewModel

- (nullable instancetype)initWithDataModel:(nullable id)dataModel{
    self = [super init];
    if (self) {
        _dataModel = dataModel;
        _cellSelectedSignal = [RACSubject subject];
    }
    return self;
}

// cellViewModel来计算高度，通过带返回值的Block，从上层数据拿高度
- (NSNumber *)cacheCellHeightWithCalculateBlock:(ZXTableCellViewModelCalculateBlock)calculateHeightBlock
{
    if (!self.rowHeight) {
        self.rowHeight = calculateHeightBlock();
    }
    return self.rowHeight;
}

@end
